<%@ page pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>




<isperp:incidentView>
	<jsp:body> 
	
<jsp:include page="../step1view.jsp"></jsp:include>

<jsp:include page="../step2view.jsp"></jsp:include>

<br></br>
<isperp:datalog businessId="${model.id }"></isperp:datalog>

	</jsp:body>
</isperp:incidentView>


<div id="dlgSetMajor" title="设置" style="padding:10px">

	原因说明：
	<textarea style="min-height:120px" placeholder="请填写设置原因"
		id="suggestion" maxlength="100" class="required"></textarea>

</div>

<script type="text/javascript">
<!--
	var type = "judgeLevel1", areMajor = "是";
	$("#dlgSetMajor").dialog({
		width : 360,
		height : 260,
		autoOpen : false,
		modal : true,
		buttons : [ {
			"text" : "确定",
			click : function() {

				var suggestion = $("#suggestion").val();

				if (!suggestion) {
					isperp.alert("请填写设置原因");
					return false;
				}

				$.ajax({
					url : "incident/incident/major/" + type,
					data : {
						"id" : "${model.id}",
						"areMajor" : areMajor,
						"suggestion" : suggestion
					},
					success : function(data) {
						if (data.success) {
							isperp.alert("设置成功");
							isperp.closeDialog({
								id : '',
								empty : true
							});
						} else {
							isperp.alert(data.data);
						}
					}
				});
			}
		} ]
	});

	function judgeLevel1() {
		type = "judgeLevel1";
		$("#dlgSetMajor").dialog('open');

	}

	function judgeMajor(v) {
		type = "judgeMajor";
		areMajor = v
		$("#dlgSetMajor").dialog('open');

	}
//-->
</script>

<isperp:buttonList>
	<c:choose>
		 
		<c:when test="${model.priorityName ne '一级' && model.areMajor ne true}">
			<button onclick="judgeLevel1()">升级为一级事件</button>
		</c:when>
	</c:choose>
	
	
	<c:choose>
		<c:when test="${model.areMajor }">
			<button onclick="judgeMajor('否')">取消大屏展示</button>
		</c:when>
		<c:otherwise>
			<button onclick="judgeMajor('是')">普通设置大屏展示</button>
		</c:otherwise>
	</c:choose>



</isperp:buttonList>


